package 笔试.转转;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

/**
 * @author:谢君臣
 * @Date:2021/9/17-20:41
 * @version:1.0
 * @function:
 */
public class Main02 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int [] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = scanner.nextInt();
        }
        Arrays.sort(arr);
        ArrayList<Integer> a = new ArrayList<>();
        ArrayList<Integer> b = new ArrayList<>();
        int temp_a = 0,temp_b=0;
        for (int i = arr.length-1 ; i >= 0; i--) {
            if (temp_a==temp_b){
                b.add(i);
                temp_b += arr[i];
            }else if (temp_a<temp_b){
                a.add(i);
                temp_a += arr[i];
            }else {
                b.add(i);
                temp_b += arr[i];
            }
        }
        if (temp_a==temp_b){
            System.out.println("YES");
            System.out.println(a.size());
            String s_a = a.toString();
            System.out.println(s_a);
            StringBuilder res_a = new StringBuilder(s_a.substring(1, s_a.length() - 1).replaceAll(",", "")).reverse();
            System.out.println(res_a);
            System.out.println(b.size());
            String s_b = b.toString();
            StringBuilder res_b = new StringBuilder(s_b.substring(1, s_b.length() - 1).replaceAll(",", "")).reverse();
            System.out.println(res_b);
        }
        else
        System.out.println("NO");
    }
}
